package simulateOS.entity;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Description：进程控制块实体类
 * Date: 2022/9/26
 * Time: 23:45
 *
 * @Author SillyBaka
 **/
@Data
public class PCB {
    /**
     * 进程标识符
     */
    private IntegerProperty pid;
    /**
     * 该进程控制块在内存中所处的位置
     */
    private int memoryIndex;


    public PCB(){
        pid = new SimpleIntegerProperty();
    }

    public PCB(int pid, int memoryIndex) {
        this();
        this.pid.set(pid);
        this.memoryIndex = memoryIndex;
    }

    public int getPid() {
        return pid.get();
    }

    public IntegerProperty pidProperty() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid.set(pid);
    }

    public int getMemoryIndex() {
        return memoryIndex;
    }

    public void setMemoryIndex(int memoryIndex) {
        this.memoryIndex = memoryIndex;
    }
}
